home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 26 / Cream of the Crop 26.iso / program / ccdl150l.zip / IO / FGETC.C < prev    next >
C/C++ Source or Header  |  1997-04-08  |  414b  |  33 lines

  1. #include <stdio.h>
  2. #include <time.h>
  3. #include <libp.h>
  4.  
  5. int fgetc(FILE *stream)
  6. {
  7.     int rv;
  8.     if (stream->token != FILTOK)
  9.         return EOF;
  10.     if (!(stream->flags & _F_READ)) {
  11.         stream->flags |= _F_ERR;
  12.         return EOF;
  13.     }
  14.     rv = _basegetc(stream);
  15.     return rv;
  16. }
  17. #undef getc
  18. #undef getchar
  19. int getc(FILE *stream)
  20. {
  21.     return fgetc(stream);
  22. }
  23. int getchar(void)
  24. {
  25.     return fgetc(stdin);
  26. }
  27.         
  28.  
  29.  
  30.  
  31.  
  32.  
  33.